package org.tailor
/**
 * The Rating entity.
 *
 * @author    
 *
 *
 */
class Rating {
    static mapping = {
         table 'rating'
         // version is set to false, because this isn't available by default for legacy databases
         version false
         id generator:'identity', column:'id'
         designIdDesign column:'design_id'
         clientIdClient column:'client_id'
    }
    Long id
    Date ratingDate
    Integer score
    // Relation
    Design designIdDesign
    // Relation
    Client clientIdClient

    static constraints = {
        id(max: 9223372036854775807L)
        ratingDate()
        score(inList: [0,1,2,3,4,5])
        designIdDesign()
        clientIdClient()
    }
    String toString() {
        return "${designIdDesign}" 
    }
}
